package com.cpi.cornpp.user.converter;

import com.cpi.cornpp.languaje.view.LanguageView;
import com.cpi.cornpp.user.dto.UserDTO;
import com.cpi.cornpp.user.view.UserView;

/**
 * 
 * @author Edgar Joao
 *
 */
public class UserConverter {

	/**
	 * Convert an UserView to UserDTO object
	 * @param userView
	 * @return
	 */
	public UserDTO convertUserViewToDto(UserView userView){
		UserDTO userDTO = null;
		userDTO = new UserDTO();
		userDTO.setUsrId(userView.getUsrId());
		userDTO.setPassword(userView.getPassword());
		
		return userDTO;
	}
	/**
	 * Convert UserView to LanguageView
	 * @param userView
	 * @return
	 */
	public LanguageView convertUserToLanguageView(UserView userView){
		LanguageView languageView = null;
		languageView = new LanguageView();
		languageView.setId(userView.getLanguage());
		languageView.setUserView(userView);
		return languageView;
	}
}
